<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>鼠标事件</title>
    <style>
        #box{
            width: 200px;
            height: 200px;
            background: red;
        }
        .test{
            width: 100px;
            height: 100px;
            background: green;
        }
    </style>
</head>
<body>
    <div id="box">
        <div class="test"></div>
    </div>
    <script src="../bing.js"></script>
    <script>
        let box = document.querySelector("#box")
        // 点击事件
        box.onclick = function(){
            console.log('点击事件...');
        }
        // 双击事件
        box.ondblclick = function(){
            console.log('双击事件...');
        }
        // 鼠标按下事件
        box.onmousedown = function(){
            console.log('鼠标按下事件...');
        }
        // 鼠标弹起事件
        box.onmouseup = function(){
            console.log('鼠标弹起事件...');
        }
        // 鼠标右键点击事件
        box.oncontextmenu = function(){
            console.log('右键点击事件...');
        }
        // 鼠标进入事件
        box.onmouseenter = function(){
            console.log('鼠标进入事件(enter)1...');
        }
        // 鼠标离开事件
        box.onmouseout = function(){
            console.log('鼠标离开事件(out)1...');
        }

        // 鼠标进入事件  在  onmouseenter 之前触发
        box.onmouseover = function(){
            console.log('鼠标进入事件(over)2...');
        }

        // 鼠标离开事件  在  onmouseout  之后触发
        box.onmouseleave = function(){
            console.log('鼠标离开事件(leave)2...');
        }

        // 鼠标移动事件
        box.onmousemove = function(){
            console.log('鼠标移动事件...');
        }
    </script>
</body>
</html>